import { get, post,put,del } from '../../../utils/request'
import { AddParams, AddResult, ListParams, ListResult } from './type'

//列表
export const getCustomerList = (data: ListParams) => {
  return get<ListParams, ListResult>('/api/customer/list', data)
}
//添加
export const addCustomer = (data: AddParams) => {
  return post<AddParams, AddResult>('/api/customer/add', data)
}

//获取单条用户信息
export const getCustomerModel = (id: number) => {
  console.log("123", id);

  return get<number, AddResult>(`/api/customer/get/${id}`)
}
//修改
export const updateCustomer=(data:AddParams)=>{
  return put<AddParams,AddResult>('/api/customer/update',data);
}

//删除
export const delCustomer=(id:number)=>{
  return del<number,null>(`/api/customer/delete/${id}`)
}

//批量删除
export const delMany=(ids:number[])=>{
  return post<number[],null>('/api/customer/deleteAll',ids)
}